﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;

namespace WebCamView.Web.Code
{
    [DataContract]
    public class MetaCamInfo
    {
        /// <summary>
        /// name and actually the only indentificator
        /// </summary>
        [DataMember]
        public string Name {get;set;}

        /// <summary>
        /// refresh time in seconds
        /// </summary>
        [DataMember]
        public int RefreshTime { get; set; }

        /// <summary>
        /// native resolution of the cam (specified by client on init action)
        /// </summary>
        [DataMember]
        public int MaxResolutionWidth { get; set; }

        /// <summary>
        /// native resolution of the cam (specified by client on init action)
        /// </summary>
        [DataMember]
        public int MaxResolutionHeight { get; set; }

        /// <summary>
        /// how often cam is refreshing
        /// </summary>
        [DataMember]
        public int FpsRate { get; set; }

        public override bool Equals(object obj)
        {
            return this.Name == (obj as MetaCamInfo).Name;
        }

        public override int GetHashCode()
        {
            return this.Name.GetHashCode();
        }
    }
}